package com.trendytech.tds.system.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.trendytech.tds.entity.OperationLog;
import com.trendytech.tds.system.dao.IOperationLogDAO;

import hm.base.dao.impl.AbstractDAO;

/**
 * 
 * @author Robin
 * 
 */
@Repository
public class OperationLogDAOImpl extends AbstractDAO<OperationLog> implements
		IOperationLogDAO {
	//private static final String MAPPER_SELECT_BY_USERIDANDRESOURCEID = "selectByUserIdAndResourceId";
	private static final String MAPPER_SELECT_FOR_FILTRATION = "selectForFiltration";
	private static final String MAPPER_DELETE_LIST = "deletelist";


	@Override
	public List<OperationLog> selectForFiltration(String beginTime, String endTime,String userId,String dangerLevel,String operateResult) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("beginTime", beginTime);
		map.put("endTime", endTime);
		map.put("userId", userId);
		map.put("dangerLevel", dangerLevel);
		map.put("operateResult", operateResult);
		return sqlSession.selectList(getMapperId(MAPPER_SELECT_FOR_FILTRATION),map);
	}


	@Override
	public int deleteList(String[] id) {
		Map<String, String[]> map = new HashMap<String, String[]>();
		map.put("id", id);
		return sqlSession.delete(getMapperId(MAPPER_DELETE_LIST), map);
	}

}
